#ifndef __TINYSRV_TCP_SOCKET_HOLDER_H__
#define __TINYSRV_TCP_SOCKET_HOLDER_H__

#include "exception.h"
#include "non_copyable.h"


namespace tinySrv
{

  DECLARE_TINYSRV_EXCEPTION(TCPSocketHolder)
  
  class TCPSocketHolder
    : NonCopyable
  {
  public:
    explicit TCPSocketHolder(bool nonBlocking);
    explicit TCPSocketHolder(int handle);
    virtual ~TCPSocketHolder();
    int GetSocket() const;
    int Detach();
    void SetNoDelay(bool useDelay);
    
  private:
    int Handle;
  };
  
}

#endif  // !__TINYSRV_TCP_SOCKET_HOLDER_H__
